package operation;

import book.BookList;

public class ExitOperation implements IOPeration{
    @Override
    public void work(BookList bookList) {
        System.out.println("退出系统...");
        int currentSize = bookList.getUsedSize();
        //在退出系统之前，将内存置为空，回收空间
        for (int i = 0; i < currentSize; i++) {
            bookList.setBook(i,null);
        }
        //利用库函数退出系统：
        System.exit(0);
    }
}
